﻿using System.Web.Optimization;
using BundleTransformer.Core.Orderers;
using BundleTransformer.Core.Transformers;

namespace ScrambledEggs.AppStart
{
    public class BundleConfig
    {
        public static void RegisterBundles(BundleCollection bundles)
        {
            var styleBundle = new Bundle("~/StyleBundle");
            var scriptBundle = new Bundle("~/ScriptBundle");

            styleBundle.IncludeDirectory("~/Content/Style", "*.css", true);

            scriptBundle.Include("~/Scripts/modernizr-2.6.2.js");
            scriptBundle.Include("~/Scripts/jquery.js");
            scriptBundle.Include("~/Scripts/jquery-ui.effects.core.js");
            scriptBundle.Include("~/Scripts/jquery.animate-colors.js");
            scriptBundle.Include("~/Scripts/jquery.blocal.js");
            scriptBundle.Include("~/Scripts/linq.js");
            scriptBundle.Include("~/Scripts/ScrambledEggs/Settings.js");
            scriptBundle.Include("~/Scripts/ScrambledEggs/Utility/*.js");
            scriptBundle.Include("~/Scripts/ScrambledEggs/DrawLoop.js");
            scriptBundle.Include("~/Scripts/ScrambledEggs/Adventure.js");
            scriptBundle.Include("~/Scripts/ScrambledEggs/GameStateProvider.js");
            scriptBundle.Include("~/Scripts/ScrambledEggs/Cooldowns.js");
            scriptBundle.Include("~/Scripts/ScrambledEggs/Modules/*.js");
            scriptBundle.Include("~/Scripts/ScrambledEggs/Game.js");
            scriptBundle.Include("~/Scripts/ScrambledEggs/Debug.js");

            styleBundle.Transforms.Add(new CssTransformer());
            styleBundle.Transforms.Add(new CssMinify());
            styleBundle.Orderer = new NullOrderer();

            scriptBundle.Transforms.Add(new JsTransformer());
            scriptBundle.Transforms.Add(new JsMinify());
            scriptBundle.Orderer = new NullOrderer();

            bundles.Add(styleBundle);
            bundles.Add(scriptBundle);
        }
    }
}